package cn.txy.system.cofig;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class LoginInterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/login/**","/course/export","/article/**","/comment/**","/start/**","/views/**")
                .excludePathPatterns("/swagger-resources/**", "/webjars/**",
                        "/v2/**", "/swagger-ui.html/**")
                .excludePathPatterns("/article/indexPage","/article/getArticleYear",
                        "/common/**","/index.html/**","/blog-archives.html/**","/common/header.vue/**","/article/getByType",
                        "/article/getByYearAndMonth","/comment/getComment/**","/article/read/","/article/star/",
                        "/comment/**","/comment","/article/**","/common/upload")
                .excludePathPatterns("/minio");
    }
}
